Notify.Params.Init
object in the Android Application class with the Core Client passed as a parameter. The Notify.Params.Init
object will then be passed to the Notify.initialize
function. There is also an onError
callback that will need to be provided which will return an instance of Notify.Model.Error
if there’s an issue initializing the client.
Note: The CoreClient used here will be the same instance of the CoreClient used in other WalletConnect Kotlin SDKs
isRegistered()
function. If the account is not registered, developers should call prepareRegistration()
and then register()
function to register the account.
Snippet below shows how to check if an account is registered and how to register an account if it’s not registered yet. Developers could use CacaoSigner
to sign the message or use their own signing method.
getActiveSubscriptions()
.
Method will return a map with the topic as the key and Notify.Model.Subscription
as the value.
getNotificationHistory()
.
getNotificationTypes()
function.
Method will return a map with the notification type id as the key and Notify.Model.NotificationType
as the value.
unregister()
. This will remove all subscriptions and messages for this account from the client’s storage.
Core.Model.Message
contains a type
field, which is a unique id of the notification type. It is recommended to use this field as a notification channel id. By doing so it will create a channel for each notification type. To allow users to granularly control which notifications they want to receive within system settings, it is recommended to create a separate channel for every dapp and every notification type they might have. By doing so user would be able to turn off notifications for specific notification type per every subscribed dapp.
NotifyClient
needs a NotifyClient.Delegate
passed to it for it to be able to expose asynchronous updates sent from the dapp. It’s recommended to set the delegate in the onCreate
function of the Application
class.